//    Copyright 2009 Nathan Michaels
//
//    This file is part of jen-breakout.
//
//    jen-breakout is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 2 of the License, or
//    (at your option) any later version.
//
//    jen-breakout is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with jen-breakout.  If not, see <http://www.gnu.org/licenses/>.

#include <stdio.h>
#include "types.h"
#include "breakout.h"
#include "levels.h"

// We'll start out with just some hard coded level data. This should
// ultimately end up in files or something. Maybe even some exported
// functions for loading and validating levels.

static int currentLevel = -1; // Global State

// This does all kinds of magic.
#include "levels.inc"

// A public function for iterating over the levels!
level_ptr_t NextLevel (void)
{
    if (++currentLevel >= (sizeof (levels) / sizeof (level_ptr_t)))
        currentLevel = 0;
    return levels[currentLevel];
}

void ResetLevels (void)
{
    currentLevel = -1;
}
